﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace POESKillTree
{
    public static class DirectoryExtensions
    {
        public static void Clear(this DirectoryInfo directory)
        {
            if (directory != null)
            {
                foreach (var file in directory.GetFiles())
                {
                    file.Delete();
                }
                foreach (var folder in directory.GetDirectories())
                {
                    folder.Clear();
                    folder.Delete();
                }
            }    
        
        }
    }
}
